<template>
  <div class="MiddleNav">
    <div class="item" v-for="(item,index) in navlists" :key="index" @click="go(item.url, 'all')">
        <div class="imgbox">
          <image :src="item.thumb" />
        </div>
        <div class="desbox">
          <p>{{item.name}}</p>
        </div>
    </div>



  </div>
</template>
<script>
  const app = getApp();
  export default {
    data(){
      return {

      }
    },
    props: {
      navlists: {
       type: Object,
       default: [
         {thumb: '../../static/qiye.png', name:'企业招聘',href:'/pages/job-second/main?type=0',type:'all'},
         {thumb: '../../static/zhaopin.png', name:'每日招聘',href:'/pages/everydate/main'},
         {thumb: '../../static/fanxian.png', name:'入职奖励',href:'/pages/job-second/main?type=1',type:'money'},
         {thumb: '../../static/tuijian.png', name:'推荐好友',href:'/pages/refer/main'}
       ]
      }
    },
    methods:{
      go(url,type){
        if(type){
          app.globalData.jobtype =  type;
        }
        wx.navigateTo({
          url: url,
          fail:function(err){
            console.log(err);
          }
        })
      },
     // isInPages(url){
        // let list = config.config.tabBar.list;
        // let flag = false;
        // list.forEach(item=>{
        //   if(item.pagePath.indexOf(url)){
        //     flag = true;
        //   }
        // });
        // return flag;
     //}
    }
  }
</script>
<style scoped>
  .MiddleNav{
    display: flex;
    width: 750rpx;
    padding: 20rpx 0;
    background: #fff;
  }
  .MiddleNav .item{
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
  }

  .MiddleNav .item .imgbox{
    display: flex;
    justify-content: center;
  }
  .MiddleNav .item .desbox{
    display: flex;
  }
  .MiddleNav .item .desbox p{
    width: 100%;
    text-align: center;
    font-size: 27rpx;
  }
  .MiddleNav .item image{
    width: 100rpx;
    height: 100rpx;
  }

</style>
